package com.cheng.reggie.mapper;

import com.cheng.reggie.entity.Employee;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface EmployeeMapper {

    @Select("SELECT * FROM employee WHERE username=#{username}")
    Employee login(Employee employee);


    //插入员工数据

    @Insert("INSERT  INTO employee VALUES(null,#{name},#{username},#{password},#{phone},#{sex},#{idNumber}," +
            "#{status},#{createTime},#{updateTime},#{createUser},#{updateUser})")
    Integer save(Employee employee);


    //根据员工姓名查询员工列表

    List<Employee> findByName(@Param("name") String name);


    // 修改员工数据
    Integer update(Employee employee);

    //通过id去编辑数据
    @Select("select * from employee where  id=#{id}")
    Employee findById(Long id);
}
